package 题目集.线段树or树状数组.树状数组;

import java.util.*;

public class Main {
    private static final int N = 100005;
    private static int n, sz;
    private static long[] fw = new long[N];

    private static void add(int x, long c) {
        for (; x <= sz; x += x & -x) {
            fw[x] = Math.max(fw[x], c);
        }
    }

    private static long qry(int x) {
        long res = 0;
        for (; x > 0; x &= x - 1) {
            res = Math.max(res, fw[x]);
        }
        return res;
    }

    public static void main(String[] args) {
        int[] arr={3, 86, 21};
        sz = n = arr.length;
        add(1,53);
        add(3,25);
        System.out.println(qry(3));
    }
}
